/**
 * amis v6.13.0
 * build time: 2025-08-12
 * Copyright 2018-2025 baidu
 */

import { __extends, __rest, __assign, __decorate, __metadata } from 'tslib';
import React from 'react';
import { filter, autobind, Renderer } from 'amis-core';
import { Shape } from 'amis-ui';
import cx from 'classnames';

/**
 * @file Shape.tsx 图形组件
 *
 * @author allenve(yupeng12@baidu.com)
 * @created: 2024/12/12
 */
var ShapeRenderer = /** @class */ (function (_super) {
    __extends(ShapeRenderer, _super);
    function ShapeRenderer() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ShapeRenderer.prototype.handleClick = function () {
        this.props.dispatchEvent('click', this.props.data);
    };
    ShapeRenderer.prototype.render = function () {
        var _a = this.props, className = _a.className, radius = _a.radius, shapeType = _a.shapeType, data = _a.data, rest = __rest(_a, ["className", "radius", "shapeType", "data"]);
        var shapeTypeValue = filter(shapeType, data) || shapeType;
        var radiusValue = +filter(radius, data) || radius;
        return (React.createElement(Shape, __assign({}, rest, { className: cx(className), shapeType: shapeTypeValue, radius: radiusValue, onClick: this.handleClick })));
    };
    __decorate([
        autobind,
        __metadata("design:type", Function),
        __metadata("design:paramtypes", []),
        __metadata("design:returntype", void 0)
    ], ShapeRenderer.prototype, "handleClick", null);
    ShapeRenderer = __decorate([
        Renderer({
            type: 'shape'
        })
    ], ShapeRenderer);
    return ShapeRenderer;
}(React.Component));

export { ShapeRenderer };
